// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
03A4: name_thread 'CEBVA' 
:CEBVA_5111
wait 0
0006: 0@ = 0
0006: 1@ = 12643640 
000A: 1@ += 920
0006: 2@ = 12631144 
0006: 3@ = 0 
0006: 4@ = 0 
0002: jump @CEBVA_5377

:CEBVA_5240
wait 0   
0006: 0@ = 0

:test_1
wait 0
000A: 0@ += 1
if
gosub @Newdelet_2
jf @test_1
gosub @CarVago_2

:CEBVA_5377
0001: wait 0 ms 
00D6: if 
0039:   4@ == 0 
004D: jump_if_false @CEBVA_6899 
0002: jump @CEBVA_5479 

:CEBVA_5479
0001: wait 0 ms 
00D6: if 
0583:   player $PLAYER_CHAR in_zone 'GRL3C' 
004D: jump_if_false @CTDVA_7002 
0002: jump @CEBVA_5585 

:CTDVA_7002
0001: wait 0 ms 
00D6: if 
0583:   player $PLAYER_CHAR in_zone 'GRL3A'  
else_jump @CTDVA_7130
0002: jump @CTDVA_7378 

:CTDVA_7130
0001: wait 0 ms 
00D6: if 
0583:   player $PLAYER_CHAR in_zone 'GRL3B' 
004D: jump_if_false @CTDVA_7257 
0002: jump @CTDVA_7378 

:CTDVA_7257
0001: wait 0 ms 
00D6: if 
0583:   player $PLAYER_CHAR in_zone 'GRL1A' 
else_jump @CRODEVA_8804
0002: jump @CTDVA_7378 

:CRODEVA_8804
0001: wait 0 ms 
00D6: if 
0583:   player $PLAYER_CHAR in_zone 'GRL2B'  
else_jump @CMARABUT_5479
0002: jump @CRODEVA_8745 

:CMARABUT_5479
0001: wait 0 ms 
gosub @prayer_zone1
0001: wait 0 ms 
if and 
0583:   player $PLAYER_CHAR in_zone 'BONE' 
gosub @check_zone_Int_1                              
004D: jump_if_false @CEBVA_5111
0002: jump @CMARABUT_5585 

:CEBVA_5585
0001: wait 0 ms 
0006: 4@ = 1  
gosub @Memory_Read
20@ = 402
21@ = 439
22@ = 466
gosub @Memory_Wirite 
gosub @loadmodels
0A8D: 3@ = read_memory 2@ size 4 virtual_protect 0 

:CEBVA_6782
0001: wait 0 ms  
0A8D: 11@ = read_memory 2@ size 4 virtual_protect 0 
000A: 0@ += 1
gosub @Newdelet_1
00D6: if 
003B:   11@ == 3@ // (int)
004D: jump_if_false @CEBVA_6899 
0002: jump @CEBVA_6782 

:CEBVA_6899
0001: wait 0 ms 
0006: 0@ = 0
00D6: if 
0039:   4@ == 1 
004D: jump_if_false @CEBVA_5479 
0006: 4@ = 0 
0085: 20@ = 5@ // (int) 
0085: 21@ = 6@ // (int) 
0085: 22@ = 7@ // (int) 
gosub @Memory_Wirite
gosub @loadmodelsb 
0002: jump @CEBVA_5240 

:CTDVA_7378
0001: wait 0 ms 
0006: 4@ = 1  
gosub @Memory_Read
20@ = 500
21@ = 545
22@ = 555
gosub @Memory_Wirite 
gosub @loadmodels
0A8D: 3@ = read_memory 2@ size 4 virtual_protect 0 

:CTDVA_8571
0001: wait 0 ms  
0A8D: 11@ = read_memory 2@ size 4 virtual_protect 0 
000A: 0@ += 1
gosub @Newdelet_1
00D6: if 
003B:   11@ == 3@ // (int)
004D: jump_if_false @CTDVA_8684 
0002: jump @CTDVA_8571 

:CTDVA_8684
0001: wait 0 ms 
0006: 0@ = 0
00D6: if 
0039:   4@ == 1 
004D: jump_if_false @CEBVA_5479 
0006: 4@ = 0 
0085: 20@ = 5@ // (int) 
0085: 21@ = 6@ // (int) 
0085: 22@ = 7@ // (int) 
gosub @Memory_Wirite
gosub @loadmodelsb 
0002: jump @CEBVA_5240 

:CRODEVA_8745
0001: wait 0 ms 
0006: 4@ = 1  
gosub @Memory_Read
20@ = 475
21@ = 536
22@ = 603
gosub @Memory_Wirite 
gosub @loadmodels
0A8D: 3@ = read_memory 2@ size 4 virtual_protect 0 

:CRODEVA_9962
0001: wait 0 ms  
0A8D: 11@ = read_memory 2@ size 4 virtual_protect 0 
000A: 0@ += 1
gosub @Newdelet_1
00D6: if 
003B:   11@ == 3@ // (int)
004D: jump_if_false @CRODEVA_10004 
0002: jump @CRODEVA_9962 

:CRODEVA_10004
0001: wait 0 ms 
0006: 0@ = 0
00D6: if 
0039:   4@ == 1 
004D: jump_if_false @CEBVA_5479 
0006: 4@ = 0 
0085: 20@ = 5@ // (int) 
0085: 21@ = 6@ // (int) 
0085: 22@ = 7@ // (int) 
gosub @Memory_Wirite
gosub @loadmodelsb 
0002: jump @CEBVA_5240 

:CMARABUT_5585
0001: wait 0 ms 
0006: 4@ = 1  
gosub @Memory_Read
20@ = 410
21@ = 466
22@ = 576
gosub @Memory_Wirite 
gosub @loadmodels
0A8D: 3@ = read_memory 2@ size 4 virtual_protect 0 

:CMARABUT_6782
0001: wait 0 ms  
0A8D: 11@ = read_memory 2@ size 4 virtual_protect 0 
000A: 0@ += 1
gosub @Newdelet_1
00D6: if 
003B:   11@ == 3@ // (int) 
004D: jump_if_false @CMARABUT_6899 
0002: jump @CMARABUT_6782 

:CMARABUT_6899
0001: wait 0 ms 
0006: 0@ = 0
00D6: if 
0039:   4@ == 1 
004D: jump_if_false @CEBVA_5377 
0006: 4@ = 0 
0085: 20@ = 5@ // (int) 
0085: 21@ = 6@ // (int) 
0085: 22@ = 7@ // (int) 
gosub @Memory_Wirite
gosub @loadmodelsb 
0002: jump @CEBVA_5240

:prayer_zone1
wait 0
Actor.StorePos($PLAYER_ACTOR, 15@, 16@, 17@)
08F1: get_zone_at 15@ 16@ 17@ nameB_to 32@s // 8-byte string 
076D: get_zone 32@s gang 2 density_to 8@ 
076D: get_zone 32@s gang 3 density_to 9@ 
return

:check_zone_Int_1
wait 0
if and
  8@ >= 95
  105 >= 8@
  9@ >= 95
  105 >= 9@
jf @check_zone_Int_2 
return

:check_zone_Int_2
wait 0
0AA1: return_if_false

:CarVago_1
wait 0 
Model.Destroy(5@)
Model.Destroy(6@)
Model.Destroy(7@)
return 

:CarVago_2
wait 0 
Model.Destroy(20@)
Model.Destroy(21@)
Model.Destroy(22@)
return 

:loadmodels
wait 0
Model.Load(20@)
Model.Load(21@)
Model.Load(22@)

:loadmodels2
if or
   not Model.Available(20@)
   not Model.Available(21@)
   not Model.Available(22@)
jf @loadmodels3 
wait 0 
jump @loadmodels2 

:loadmodels3
return 

:loadmodelsb
wait 0
Model.Load(5@) 
Model.Load(6@)
Model.Load(7@)

:loadmodelsb2
if or
   not Model.Available(5@)
   not Model.Available(6@)
   not Model.Available(7@)
jf @loadmodelsb3 
wait 0 
jump @loadmodelsb2 

:loadmodelsb3
return 

:Memory_Read
wait 0
0A8D: 5@ = read_memory 1@ size 2 virtual_protect 0 
000A: 1@ += 2 
0A8D: 6@ = read_memory 1@ size 2 virtual_protect 0 
000A: 1@ += 2 
0A8D: 7@ = read_memory 1@ size 2 virtual_protect 0 
000E: 1@ -= 4 
jf @Memory_Read
return

:Memory_Wirite
wait 0
0A8C: write_memory 1@ size 2 value 20@ virtual_protect 0 
000A: 1@ += 2 
0A8C: write_memory 1@ size 2 value 21@ virtual_protect 0 
000A: 1@ += 2 
0A8C: write_memory 1@ size 2 value 22@ virtual_protect 0 
000E: 1@ -= 4 
jf @Memory_Wirite
return

:Newdelet_1
wait 0
if 
0@ == 2
jf @Newdelet_1A
gosub @CarVago_1

:Newdelet_1A
return

:Newdelet_2
wait 0
if 
0@ == 2
jf @Newdelet_2A 
return

:Newdelet_2A
wait 0
0AA1: return_if_false